<?php

namespace app\company\model;

use app\common\model\BaseModel;
use app\common\model\Driver;
use think\model\relation\HasMany;
use think\model\relation\HasOne;

class Delivery extends BaseModel
{
    const REVIEW_ONE = 1;// 正常
    const REVIEW_TWO = 2;// 已驳回

    public function middleOrder(): HasMany
    {
        return $this->hasMany(DeliveryOrder::class, 'delivery_id', 'id');
    }

    public function driver(): HasOne
    {
        return $this->hasOne(Driver::class, 'id', 'driver_id');
    }
}